﻿using BLL.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL.Repositories
{
    public class UserRepository : Repository<User>
    {
        public UserRepository(SqlDbContext context) : base(context)
        {

        }
  
        public User GetByName(string name) //传进来的Model自动绑定的name
        {
            return dbset
                .Where(s => s.Name == name)
                .SingleOrDefault();
        }
        //public int Save(User user)
        //{
        //    dbSet.Add(user);
        //    context.SaveChanges();
        //    return user.Id;
        //}
    }
}
